using System;
using System.Data.Entity.ModelConfiguration;
using System.Data.Common;
using System.Data.Entity;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using MAPDavy.Entities;

namespace MAPDavy.Repository.Mapping
{
	public class MAPMap : EntityTypeConfiguration<MAP>
	{
		public MAPMap()
		{
			// Primary Key
			this.HasKey(t => t.Id);

			// Properties
			this.Property(t => t.NameMap)
				.IsRequired()
				.HasMaxLength(250);
				
			this.Property(t => t.Description)
				.IsRequired()
				.HasMaxLength(250);
				
			// Table & Column Mappings
			this.ToTable("MAP");
			this.Property(t => t.Id).HasColumnName("Id");
			this.Property(t => t.NameMap).HasColumnName("NameMap");
			this.Property(t => t.Description).HasColumnName("Description");
		}
	}
}

